How jquery is positioned on the page, we can use jquery's Aminate animation method to locate, there is a rough example below, interested friends can refer to the followingThe Aminate animation method is positioned through jquery. Examples are as follows: The code is as follows: Scrolloffset ($ ("#qa"). offset ()); JQuery positioning allows the body's scrolltop equal to the top of the POS, which implements
How does jQuery locate the specific location of the page? We can use the aminate animation method of jQuery to locate the location. The following is an example. If you are interested, refer to the aminate animation method of jQuery.
Example:
The Code is as follows:
Scroloffset ($ ("# qa"). offset ());// JQuery positioned to make the scrollTop of the body equal to the top of the pos, and then implem
and turns.Create a hidden anchor, add an onclick event when you click the button, and call the anchor's click event through js to save the country....There are a lot of text here, to open the page and support the scroll bar...Hide and scroll here...Add more text...OK, success! Now that the button is successful, you can do anything else. img and div can do this.There is also a way to do this through jQuery's aminate animation method. I post the codeTh
jump ...here is a lot of text, put the page open, hang out the scroll bar... id="pos"> scroll here Hide and scroll to here...add more Text ....OK, Success! What if you want to click a button to scroll to the specified position? button buttons can not add href, only zigzag solution. First create a hidden anchor point, and then click on the button to add an onclick event, and then through the JS to invoke the anchor point click Event, the curve to salvation. type= "Button" value= "c
give face. You can only use another method. Can you specify an ID for the anchor to scroll here? Try
... There are a lot of text here. Open the page and pull out the scroll bar... OK, success! It seems that it is a good way to change to id. Now try changing the anchor to Div.
... There are a lot of text here. Open the page and pull out the scroll bar... OK, success! This solves the problem. You do not need to insert a OK, success! What if you want to click a button to scroll to the specified po
? button buttons cannot add href and can only be resolved in twists and turns.First set up a hidden anchor point, and then click button to add an onclick event, and then through JS to call the anchor point click Event, Curve Save the nation....Here are a lot of text, put the page open, hold out the scroll bar...Hide and scroll to here...Add more Text...OK, Success! Since the button can be successful, then the other is good to do, img,div can do so.There is also a way to do it through JQuery's
Contact Us
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.